import { createStore, combineReducers, applyMiddleware } from 'redux';
import createSagaMiddleware from 'redux-saga'
import { composeWithDevTools } from 'redux-devtools-extension';

import userReducer from './reducers/user'

import mySaga from './saga/mySaga'
import rootSaga from './saga/rootSaga'

const sagaMid = createSagaMiddleware();

const store = createStore(
    combineReducers({
        user: userReducer
    }),
    composeWithDevTools(
        applyMiddleware(sagaMid)
    )
)

sagaMid.run(mySaga)
sagaMid.run(rootSaga)

export default store
